Skip to content

Clarify non-leaf hierarchical command handlers#630

Open
AboMeezO wants to merge 5 commits into
neplextech:mainfrom
AboMeezO:fix/non-leaf-node-diagnostic
Open

Clarify non-leaf hierarchical command handlers#630
AboMeezO wants to merge 5 commits into
neplextech:mainfrom
AboMeezO:fix/non-leaf-node-diagnostic

Conversation

@AboMeezO
Copy link
Copy Markdown
Contributor

@AboMeezO AboMeezO commented May 30, 2026

Summary

This PR clarifies and improves non-leaf hierarchical command handling.

A parent hierarchical command file can still define metadata/config, but executable handlers must live on leaf nodes.

src/app/commands/
└── [admin]/
    ├── command.ts        # non-leaf node: metadata/config is valid here
    └── [logs]/
        └── command.ts    # leaf node: executable handlers belong here

If [admin]/command.ts exports chatInput, message, or autocomplete while [admin] has children, CommandKit now logs a highlighted warning, ignores those executable exports, and continues loading valid leaf routes like /admin logs.

The router diagnostic remains as secondary scan feedback, but the main developer-facing fix now happens in the runtime loader.

image

Tests

  • .\node_modules\.bin\vitest.CMD run src/app/handlers/AppCommandHandler.hierarchical.test.ts src/app/router/CommandsRouter.test.ts
  • pnpm --dir packages/commandkit build
  • pnpm --filter test-bot build
  • pnpm --filter test-bot start with PORT=54346; verified the warning appears and command loading continues, then local startup stops at invalid Discord token

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@AboMeezO is attempting to deploy a commit to the Neplex Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant